import Vue from 'vue';
import lodash from 'lodash';
const getters = {
	token: (state) => {
		let token = state.common.token;
		return lodash.isEmpty(token) ? Vue.prototype.$session.get('token') : token;
	},
	siteInfo: (state) => {
		let siteInfo = state.common.siteInfo;
		return lodash.isEmpty(siteInfo) ? Vue.prototype.$local.get('siteInfo') : siteInfo;
	},
	userInfo: (state) => {
		let userInfo = state.common.userInfo;
		return lodash.isEmpty(userInfo) ? Vue.prototype.$local.get('userInfo') : userInfo;
	},
	menuData: (state) => {
		let menuData = state.common.menuData
		return lodash.isEmpty(menuData) ? Vue.prototype.$local.get('menuList') : menuData;
	},
	authButton: (state) => {
		let authButton = state.common.authButton;
		return lodash.isEmpty(authButton) ? Vue.prototype.$local.get('authButton') : authButton;
	},
	departTree: (state) => {
		let departTree = state.depart.departTree;
		return lodash.isEmpty(departTree) ? Vue.prototype.$local.get('departData') : departTree;
	},
	classifyData: (state) => {
		let classifyData = state.common.classifyData;
		return lodash.isEmpty(classifyData) ? Vue.prototype.$local.get('classifyData') : classifyData;
	},
	webSiteInfo: (state) => state.front.webSiteInfo
};
export default getters;